package org.compression.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.model.business.Audio;
import org.model.comm.Page;

@Mapper
public interface AudioMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Audio record);

    int insertSelective(Audio record);

    Audio selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Audio record);

    int updateByPrimaryKey(Audio record);
    

    @Select("select * from audio limit #{currentPageNum},#{pageSize}")
 	public List<Audio> getPageAudio(Page mPage);
    
    
    @Select("select count(*) from audio")
 	public long getTotal();

    @Select("select * from audio where name like CONCAT('%',#{name},'%') ")
	public List<Audio> selectName(Audio mAudios);
    
    @Insert("insert into audio (name) values (#{name})")
    @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
    public int insertAudio(Audio mAudio); 
  
    @Insert("insert into audio (name,createdate,attr) values (#{name},#{createdate},#{attr})")
    @Options(useGeneratedKeys=true, keyProperty="id", keyColumn="id")
    public int insertAudioDate(Audio mAudio); 
    
    
    @Select("select id from  audio  where createdate=#{createdate}")
    public List<Integer> selectCreateTime(String createdate); 
    
  
    
    @Select("select id from  audio  where attr=#{attr}")
    public List<Integer> selectUUID(String attr); 
    
}